<#compress>
<!DOCTYPE html>
<html>
	<head>
		<title>数据字典</title>
		<meta name="keywords" content="keyword1,keyword2,keyword3">
		<meta name="description" content="this is my page">
		<meta name="content-type" content="text/html; charset=UTF-8">
		<base href="${webroot}">
		<#include "../../template/easyui.ftl" parse="true" encoding="UTF-8">
		<script type="text/javascript" src="res/rbac/const.js"></script>
	</head>
	<body>
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'west',split:true,border:false" style="width:20%;">
            	<div class="easyui-panel" style="padding:5px;border: 0px">
					<ul class="easyui-tree" id="consttree" style="padding-top: 10px;"
						data-options="
							url: 'const/const_native_tree.tree',
							method: 'get',
							lines: true,
							loadFilter: convert,
							onSelect: module.onSelectTree,
							onLoadSuccess: module.onLoadSuccessTree
					"></ul>
				</div>
            </div>
			<div data-options="region:'center',border:false">
				<table class="easyui-datagrid"  id="constgrid"
				  		 data-options="
				  		 	striped:true,
				  		 	border:false,
				  		 	url: 'const/const_list.grid',
				  		 	method: 'get',
				  		 	rownumbers: true,
				  		 	pagination: true,
				  		 	fit: true,
				  		 	toolbar: '#tb',
				  		 	onDblClickRow: module.onDblClickRow
				  		 ">
					<thead>
						<tr>
							<th data-options="field:'',width:50,checkbox:true"></th>
							<th data-options="field:'id',width:50">ID</th>
							<th data-options="field:'text',width:250,formatter:flagFormat">Key</th>
							<th data-options="field:'c_value',width:150">Value</th>
							<#--
							<th data-options="field:'c_type',width:100,
								formatter:function(value, row, index) {
									switch (value) {
									case '0':
										value = '类型';
										break;
									case '1':
										value = '数据';
										break;
									}
									return value;
								}">常量类型</th>
							-->
							<th data-options="field:'c_retention',width:70,formatter:retentionFormat">保留级别</th>
							<th data-options="field:'parent',width:150">父级</th>
							<th data-options="field:'c_desc',width:300,
								formatter:function(value, row, index) {
									return Common.Util.formatter(value);
								}">备注</th>
						</tr>
					</thead>
				</table>
				<div id="tb" style="padding:5px;height:auto">
					<div style="margin-bottom:5px">
						常量名称:
						<input id="constname" class="easyui-textbox" data-options="prompt:'输入关键字进行查询'" style="width:140px;">
						常量值:
						<input id="constvalue" class="easyui-textbox" data-options="prompt:'输入关键字进行查询'" style="width:140px;">
						<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-search" onclick="module.queryDatagrid();">查询</a>
						<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-reload" onclick="module.refreshDatagrid();">刷新</a>
						<br>
						<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-load" onclick="module.expandTree();">展开</a>
						<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-load" onclick="module.collapseTree();">收缩</a>
						<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-add" action="add" onclick="module.openDialog();">新增</a>
						<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-edit" action="modify" onclick="module.modify();">修改</a>
						<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-no" action="deleted" onclick="module.deleted();">删除</a>
					</div>
				</div>
			</div>

			<div id="cdialog" class="easyui-dialog" title="编辑"
				style="width:360px;height:420px;padding-left: 20px;padding-top: 10px;"
				data-options="resizable:true,modal:true,buttons:'#dlg-buttons',closed:true">
				<form name="cfrom" id="cfrom" method="post">
					<div>
						<input type="hidden" name="id" value="">
						<font style="font-size: 14px;">key:</font><br />
						<input name="CName" id="CName" maxlength="30" class="easyui-textbox"
							data-options="required:true" style="width:300px;"><br>
					</div>
					<div>
						<font style="font-size: 14px;">value:</font><br />
						<input name="CValue" id="CValue" data-options="multiline:true,required:true" maxlength="200"
							class="easyui-textbox" style="width:300px;height:50px"><br>
					</div>
					<div>
						<font style="font-size: 14px;">类型:</font><br />
						<select name="CType" id="CType" maxlength="30" class="easyui-combobox"
							data-options="required:true,editable:false" panelheight="auto" style="width:300px;">
							<option value='0'>类型(分类)</option>	
							<option value='1'>数据</option>	
							
						</select><br>
					</div>
					<div>
						<font style="font-size: 14px;">保留级别:</font><br />
						<select name="CRetention" id="CRetention" maxlength="30" class="easyui-combobox"
							data-options="required:true,editable:false" panelheight="auto" style="width:300px;">
							<option value='0'>内存</option>	
							<option value='1'>数据表（离线）</option>	
							
						</select><br>
					</div>
					<div>
						<font style="font-size: 14px;">上级:</font><br />
						<input name="CParentId" id="CParentId" class="easyui-combotree"
							data-options="
								required:true,
								url: 'const/const_native_tree.tree',
								method: 'get',
								lines: true,
								loadFilter: convertTreeAppendRoot"
							style="width:300px;"><br>
					</div>
					<div>
						<font style="font-size: 14px;">说明:</font><br />
						<input name="CDesc" id="CDesc" data-options="multiline:true,required:true" maxlength="200"
							class="easyui-textbox" style="width:300px;height:50px"><br>
					</div>
				</form>
			</div>
			<div id="dlg-buttons">
				<a href="javascript:void(0);" class="easyui-linkbutton" onclick="module.edit()">保存</a>
				<a href="javascript:void(0);" class="easyui-linkbutton" onclick="module.closeDialog()">取消</a>
			</div>
		</div>
	</body>
</html>
</#compress>